package cn.fzkj.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RefreshScope // 加在controller上面才会生效
@RestController
public class IndexController {

    @Value("${server.port}")
    String port;

    @Value("${cloud.info}")
    String value;

    @RequestMapping("/index")
    public String index(){
        return port + " 端口上 " + value;
    }
}
